int vat_mat(long n, int A[n][n], int B[n][n],
            long i, long k)
{
    long j;
    int res = 0;
    for ( j=0; j<n; j++ )
        res += A[i][j] * B[j][k];
    return res;
 